function removeAlphabet(id)    
{        
	var element = document.getElementById(id);        
	if(isNaN(new Number(element.value)))                
		element.value = element.value.substring(0, element.value.length - 1)     
}

function displayMsg(divMsg)    
{        
	setTimeout("$(\"#"+divMsg+"\").hide(1000)",5000)
}

function isNumeric(strString)
{
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   for (i = 0; i < strString.length && blnResult == true; i++)
	  {
	  strChar = strString.charAt(i);
	  if (strValidChars.indexOf(strChar) == -1)
		 {
		 blnResult = false;
		 }
	  }
   return blnResult;
}

function isNumeric(strString)
{
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   for (i = 0; i < strString.length && blnResult == true; i++)
	  {
	  strChar = strString.charAt(i);
	  if (strValidChars.indexOf(strChar) == -1)
		 {
		 blnResult = false;
		 }
	  }
   return blnResult;
}
   
function roundNumber(number,decimal_points) {
	if(!decimal_points) return Math.round(number);
	if(number == 0) {
		var decimals = "";
		for(var i=0;i<decimal_points;i++) decimals += "0";
		return "0."+decimals;
	}

	var exponent = Math.pow(10,decimal_points);
	var num = Math.round((number * exponent)).toString();
	return num.slice(0,-1*decimal_points) + "." + num.slice(-1*decimal_points)
}

// number formatting function
// copyright Stephen Chapman 24th March 2006, 22nd August 2008
// permission to use this function is granted provided
// that this copyright notice is retained intact

function formatNumber(num,dec,pnt) 
{
	var thou=","
	var x = Math.round(num * Math.pow(10,dec));
	if (x >= 0) 
		n1=n2='';
	var y = (''+Math.abs(x)).split('');
	var z = y.length - dec; 
	if (z<0) z--; 
	
	for(var i = z; i < 0; i++) 
		y.unshift('0'); 
	
	if (z<0) 
		z = 1; 
	y.splice(z, 0, pnt); 
	
	if(y[0] == pnt) 
		y.unshift('0'); 
	
	while (z > 3) 
	{
		z-=3; 
		y.splice(z,0,thou);
	}
	
	var r = y.join('');
	return r;
}

function validateInteger(num)
{
	if(num=="" || !isNumeric(num) )	
	{
		return 0;
	}else{
		return num;
	}
}